<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib uri="/WEB-INF/tld/ce.tld" prefix="ce" %>
<%
String path = request.getContextPath();
String modifyActionName = path+request.getAttribute("REQUEST_PATH")+"?op=savejs";
String curRootOrgLevel="",rootOrgId="";
if(request.getAttribute("rootOrgLevel")!=null)
	curRootOrgLevel=request.getAttribute("rootOrgLevel").toString();
if(request.getAttribute("rootOrgId")!=null)
	rootOrgId=request.getAttribute("rootOrgId").toString();
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>检举信息台账添加</title>
<script type="text/javascript">
var curRootOrgLevel='<%=curRootOrgLevel%>';
<!--
           $(function(){
        	 <%--  
       	     $('#checkDeptId').combotree({
    			    url:'<%=path%>/util/util_searchOrgJsonTree.action?viewType=self&',
    			    params:{},
    			    valueField:'id',
    		        textField:'text',
    		        panelWidth:200,
    		        multiple:true, 
                    cascadeCheck:false
    		        });
    		        
               $('#code').validatebox({
                   required:'true',
                   missingMessage:'必须输入编号',
                   validType:'length[1,20]'
               });
               --%>
               $('#reportFromNum').validatebox({
                   required:'true',
                   missingMessage:'请选择检举来源',
                   validType:'length[1,20]'
               });
               
               
               
               
               
               if('1'==curRootOrgLevel){
            	   $('#inspectionDeptId').combobox({
                  		url:'<%=path %>/util/util_getInspectionList.action?id=15009070000',
                  		valueField:'id',
                  		textField:'text',
                  		editable:false,
                  		onChange: function(n,o){
                  			var url = '<%=path %>/util/util_getInspectionList.action?id='+n;
                  			$('#collectionDeptId').combobox('reload', url);
                  		}
                  	});
                     
                     $('#collectionDeptId').combobox({
                   		url:'<%=path %>/util/util_getInspectionList.action?id='+$('#inspectionDeptId').val(),
                   		valueField:'id',
                   		textField:'text',
                   		editable:false
                   	});
                     
                     if($('#inspectionDeptId').val()){
                     	   $('#inspectionDeptId').combobox('setValue',$('#inspectionDeptId').val());
                     	   $('#inspectionDeptId').change();
                        }
                        if($('#collectionDeptId').val()){
                     	   $('#collectionDeptId').combobox('setValue',$('#collectionDeptId').val());
                        }
               }else if('2'==curRootOrgLevel){
            	   $('#collectionDeptId').combobox({
                  		url:'<%=path %>/util/util_getInspectionList.action?id=<%=rootOrgId%>',
                  		valueField:'id',
                  		textField:'text',
                  		editable:false
                  	});
            	   
                    if($('#collectionDeptId').val()){
                 	   $('#collectionDeptId').combobox('setValue',$('#collectionDeptId').val());
                    }
               }       
              
              
              
               
               $('#taxpayerNumber').validatebox({
                   required:'true',
                   missingMessage:'必须输入纳税人识别号',
                   validType:'length[1,20]'
               });
               $('#legalPerson').validatebox({
                   required:'true',
                   missingMessage:'必须输入法定代表人',
                   validType:'length[1,20]'
               });
               
               $('input[name="po.reportFlag"]').click(function(){
            	   if(this.value=="0"){
            		   //$('#reportPerson').focus();
            		   $('#reportPerson').attr('readonly',false);
            	   }else{
            		   $('#reportPerson').val('');
            		   $('#reportPerson').attr('readonly',true);
            	   }
            	   
               });
               
				$('#taxpayerNumber').change(function(){
					if($('#taxpayerNumber').val()){
						$.post("<%=path%>/cases/report/ReportTaxIllegal_getNsrinfoByTaxpayerNumber.action?taxpayerNumber="+$('#taxpayerNumber').val(),function(data)
								{
							 		jsonReStr = jQuery.parseJSON(data);
							 		
							 		if(jsonReStr.opState=="failure"){  //操作失败处理
							 			if('1'==curRootOrgLevel){
							 				$('#inspectionDeptId').combobox('setValue','');
								 			$('#collectionDeptId').combobox('setValue','');
							 			}else if('2'==curRootOrgLevel){
							 				$('#inspectionDeptId').val('');							            	
							 				$('#collectionDeptId').combobox('setValue','');							 				
							 			}else{
							 				$('#inspectionDeptId').val('');							            	
							 				$('#collectionDeptId').val('');							 				
							 			}
							 			if($('#inspectionDept_'))
							 				$('#inspectionDept_').html(jsonReStr.jcjmc);
							 			if($('#collectionDept_'))
						 					$('#collectionDept_').html(jsonReStr.zgswjMc);
							 			$('#taxEnterprice').val('');
						            	$('#reportCount').val('0');
						            	
							 			$('#inspectionDept').val('');
							 			$('#collectionDept').val('');
						                $.messager.alert('消息提示','操作处理失败！原因如下：<br><font color=red>'+jsonReStr.opInfo+'</font>','error');
						               // $('#taxpayerNumber').val('');
							 			//return ;
						            }else{
						            	
						            	if('1'==curRootOrgLevel){
						            		$('#inspectionDeptId').combobox('setValue',jsonReStr.jcjdm);
						            		$('#collectionDeptId').combobox('setValue',jsonReStr.zgswjDm);
							 			}else if('2'==curRootOrgLevel){
							 				$('#collectionDeptId').combobox('setValue',jsonReStr.zgswjDm);						 				
							 			}else{
							 				$('#inspectionDeptId').val('');							            	
							 				$('#collectionDeptId').val('');							 				
							 			}	
						            	
						            	if($('#inspectionDept_')){
						            		$('#inspectionDept_').html(jsonReStr.jcjmc);	
						            	}
						            	if($('#collectionDept_'))
						            		$('#collectionDept_').html(jsonReStr.zgswjMc);
						            	
						            	$('#inspectionDept').val(jsonReStr.jcjmc);						            	
						            	$('#taxEnterprice').val(jsonReStr.nsrmc);
						            	$('#reportCount').val(jsonReStr.status);						            	
						            	$('#collectionDept').val(jsonReStr.zgswjMc);
						            	
						            }
							 		
							 	}
							 	);	
					}
					
               	});
             
	           //点击添加按钮操作
			   $('#addBtn').click(function(){
				  //给字典项目赋名称
				  $('#reportFromName').val($('#reportFromNum option:selected').text());
				  $('#reportTypeName').val($('#reportTypeNum option:selected').text());
				  //$('#dealWayName').val($('#dealWayNum option:selected').text());
				  //$('#checkDept').val($('#checkDeptId').combotree('getText'));
                  $('#addForm').submit();
	            });
	            //表单验证及提交处理操作
	           $('#addForm').form({
			        url:'<%=modifyActionName%>',
			        onSubmit: function(){
			           if($(this).form('validate')){
			                 $.util.showLoading();
			                 $('#operateWindow').window('close');
                            return true;
			             }else{
			                return false;
			             }
			        },
			        success:function(data){
			            $.util.removeLoading();
                        returnOptMsg(data);
			        }
				});
	            
	           $('#fileTr').css('display',$('#fileTd').html()!=''?"":"none");
			    $('#uploadFile').click(function(){
			    	if($('#uploadFile').css('color')=='gray')
			    		return;
			    	fileupload('fileId',null,'fileTd','approve',{param:{urlSplit:'&nbsp;'}},function(){
			    		$('#fileTr').css('display',$('#fileTd').html()!=''?"":"none");
			    	});
			    }); 
	            
           });
//-->
</script>
</head>
<style  type="text/css">
 .tb_add_th td input.lineText {border-bottom:1px solid #ccc; border-top:0px; border-left:0px; border-right:0px; background-color:transparent;}
</style>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >
<form id="addForm" method="post">
<s:hidden name="po.vcId"/>
<s:hidden id="fileId" name="po.fileId"/>
<s:hidden id="reportFromName" name="po.reportFromName"/>
<s:hidden id="reportTypeName" name="po.reportTypeName"/>
<s:hidden id="inspectionDept" name="po.inspectionDept"/>
<s:hidden id="collectionDept" name="po.collectionDept"/>
<s:hidden id="dealWayName" name="po.dealWayName"/>
<s:hidden id="checkDept" name="po.checkDept"/>
<fieldset style="border:1px solid #d2dfe6;font-weight:bold;">
    <legend>检举信息</legend>
<table align="center" width="100%"  class="tb_add_th">

<tr>
<th align="left">检举人信息:</th><td><s:radio name="po.reportFlag" list="#{1:'匿名',0:'实名'}" value="1"/></td>
<th align="left" width="150px">检举人:</th><td><s:textfield id="reportPerson" name="po.reportPerson"  style="width:150px;"/></td>
</tr>
<tr><th align="left">证件名称:</th><td><s:textfield id="certificatesName" name="po.certificatesName" style="width:150px;"/></td> 
    <th align="left">证件号码:</th><td><s:textfield id="certificatesCode" name="po.certificatesCode" style="width:150px;"/></td>
</tr>
<tr><th align="left">联系电话:</th><td><s:textfield id="contactNumber" name="po.contactNumber" style="width:150px;"/></td>
    <th align="left">检举形式:</th><td>
    <ce:dictSelect id="reportTypeNum" name="po.reportTypeNum" dictName="检举台账管理-检查形式" blankOption="true" style="width:150px;"/>
    </td>
</tr>
<tr><th align="left">接到检举时间:</th>
<td><input id="reportTime" name="po.reportTime" value="<s:date name="po.reportTime" format="yyyy-MM-dd"/>" class="Wdate" onclick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm'})" readonly="true"  style="width:150px;"/>
</td>
<th align="left">检举来源:</th><td><ce:dictSelect id="reportFromNum" name="po.reportFromNum" dictName="检举台账管理-检举来源" blankOption="true"  style="width:150px;"/>
</tr>

<tr><th align="left">纳税人识别号:</th><td><s:textfield id="taxpayerNumber" name="po.taxpayerNumber" style="width:150px;"/><font color="red">*</font></td>
    
    <th align="left">被检举人:</th><td><s:textfield id="prosecutedPerson" name="po.prosecutedPerson" style="width:150px;"/>
</tr>

<tr><th>管辖稽查局:</th><td>
<% if("1".equals(curRootOrgLevel) ){ %>
<s:textfield id="inspectionDeptId"  name="po.inspectionDeptId" />
<%
}else{
%>
<s:hidden id="inspectionDeptId" name="po.inspectionDeptId"/><!-- 跨区局 -->
<div id="inspectionDept_"><s:property value="po.inspectionDept"/></div>
<%
}
%>
</td>
		<th>所属征管局:</th><td>
		<% if("1".equals(curRootOrgLevel)||"2".equals(curRootOrgLevel)){ %>
			<s:textfield id="collectionDeptId"  name="po.collectionDeptId" />
		<%
		}else{
		%>
		<s:hidden id="collectionDeptId" name="po.collectionDeptId"/><!-- 征管局 -->
		<div id="collectionDept_"></div>
		<%
		}
		%>
		</td>
</tr>
		
<tr><th align="left">企业名称:</th><td colspan="3"><s:textfield id="taxEnterprice" name="po.taxEnterprice" style="width:150px;"/></td></tr>
<tr>
    <th align="left">被检举人地址:</th><td><s:textfield id="prosecutedPersonAddr" name="po.prosecutedPersonAddr" style="width:150px;"/></td>
    <th align="left">检举次数:</th><td><s:textfield id="reportCount" name="po.reportCount" style="width:150px;"/></td>
</tr>


<tr><th align="left">检举材料:</th><td colspan="3"><s:textarea id="reportData" name="po.reportData" style="width:96%" rows="5"/></td></tr>
<tr><th align="left">检举主要内容:</th><td colspan="3"><s:textarea id="reportContent" name="po.reportContent" style="width:96%" rows="5"/></td></tr>
<tr><th align="left">备注:</th><td colspan="3"><s:textarea id="note" name="po.note" style="width:96%" rows="5"/></td></tr>
<tr>
    <th align="left">记录人:</th><td><s:textfield  id="recorder" name="po.recorder" style="width:150px;"/></td>
    <th align="left">记录日期:</th>
   <td>
     <input id="recordDate" name="po.recordDate" value="<s:date name="po.recordDate" format="yyyy-MM-dd"/>" class="Wdate"  readonly="true"  style="width:150px;"/>
   </td>
</tr>
<tr>
    <th align="left">受理单位处理意见:</th><td colspan="3"><s:radio name="po.dealResult" list="#{1:'快速处理',2:'移交市局（备选）',3:'转交其他部门'}"/></td>
</tr>
<tr>
    <th align="left">书面材料移送:</th><td colspan="3"><s:radio name="po.evoke" list="#{1:'是',0:'无'}"/></td>
</tr>

<tr><th align="left">电子材料：</th><td colspan=3><a id="uploadFile" href="javascript:void(0)">点击上传电子材料</a></td></tr>
     <tr id="fileTr" colspan=4><td id="fileTd" colspan="4">
	  <s:property value="po.fileHtml" escape="false"/>
	  </td>
  </tr>

</table>
</fieldset>
<br/>
<%--
<fieldset style="border:1px solid #d2dfe6;font-weight:bold;">
    <legend>处理情况</legend>
<table align="center" width="100%"  class="tb_add_th">
  <tr><th style="text-align:left;width:15%">是否处理</th><td><s:radio name="po.directorPassFlag" list="#{1:'已处理','0':'未处理'}"/></td></tr>
<tr><th style="text-align:left">处理情况</th><td style="valign:middle;"><s:textarea name="po.directorAdvice"/></td></tr>
<tr><td colspan="2">经办人:<s:textfield name="po.director" style="width:100px;" cssClass="lineText"/>&nbsp;&nbsp;日期:<input type="text" name="po.directorApprDate" value="<s:date name="po.directorApprDate" format="yyyy-MM-dd"/>" style="width:100px;" class="Wdate lineText" onclick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'})" readonly="true"/></td>
</tr>
</table>
</fieldset>
 --%>
</form>
</body>
</html>


